package com.dgut.doctorservice.controller;


import com.dgut.commonutils.Result;
import com.dgut.doctorservice.entity.MedecineInfo;
import com.dgut.doctorservice.entity.MedecineManager;
import com.dgut.doctorservice.service.MedecineInfoService;
import com.dgut.doctorservice.service.MedecineManagerService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.ArrayList;
import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author dgut
 * @since 2021-09-11
 */
@RestController
@RequestMapping("/doctorservice/medecine-manager")
@CrossOrigin
public class MedecineManagerController {

    @Autowired
    MedecineManagerService medecineManagerService;

    @Autowired
    MedecineInfoService medecineInfoService;

    @ApiOperation("药品进行入库操作")
    @PostMapping("addManager")
    public Result addMedecineManager(@RequestParam String medecineId,@RequestParam Integer number){
        medecineManagerService.inputManager(medecineId,number);
        return Result.succ();
    }

    @ApiOperation(("药品出库操作"))
    @PostMapping("output")
    public Result outputMedecine(@RequestParam String medecineId,@RequestParam Integer number){
        medecineManagerService.outputManager(medecineId,number);
        return Result.succ();
    }




}

